<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>详情</title>
	<meta name="format-detection" content="telephone=no"/>
	<link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/common.css" />
	<link rel="stylesheet" type="text/css" href="../css/aui.css" />
	<style>
		html, body {width: 100%;min-height: 100%;}
		#header{width: 100%; text-align: left; height:auto; margin: 20px 0px; border-bottom: 1px solid #bebfbf;}
		#header #listtitle{ width: 90%; margin:0px 5% 20px 5%; font-size: 1.3em; font-weight: bold;}
		#header .info{width: 90%; margin:10px 5% ;}
		.info {margin-top: 9px;/* margin-bottom: 11px;*/ color: #666; font-size: 0.9em; position: relative; line-height: 15px; display: box; display: -webkit-box; height: 15px; }
		.info #from {font-size: 1em; color: #666; display: block; margin-top: 1px; }
		.info #date {color: #666; font-size: 1em; line-height: 15px; margin-right: 5px; margin-top: 1px; position: absolute; right: 0;}
		#main { line-height: 26px; margin:0px 5%;font-size:1.1em;width: 90%;}
		#main em{ font-size: 1.2em; font-weight: bold; line-height: 32px;}
		#url {word-break:break-all; color: #19B4FF;}
		.description{ margin: 20px 0px;}
		#footer{ height:100px;background: #ffffff;}
		#content{ width: 100%; word-break:break-all;}
		img { width:100%; height: auto; margin-left:auto; margin-right:auto;}
	</style>
</head>
<body>
	<div id="header">
  		<div id="listtitle"></div>
   		<div class="info">
    		<span id="from"></span>
			<span id="date"></span>
   		</div>
	</div>
    <div id="main">
    	<ul id='ul_imgList' class="aui-list-view aui-grid-view"> 
         	 
		</ul>
  		<div class="main_url">
     		<em>链接:</em>
      		<span id="url"></span>
  		</div>
  		<div class="description">
     		<em>摘要：</em>
       		<div id="description"></div>
   		</div>
  		<div class="content">
       		<em>正文:</em>
       		<div id="content"></div>
   		</div>
   		<div class="remarks">
       		<em>备注:</em>
       		<div id="remarks"></div>
  		</div>
   		<div class="contact">
      		<em>大众舆情业务联系人：</em>
        	<div id="contact"></div>
    	</div>                     
  	</div>	     
	<footer id="footer">	 
	</footer> 
</body>
<script type="text/javascript" src="../script/api.js"></script>  
<script type="text/javascript" src="../script/alpenlicebe.js"></script>   
<script type="text/javascript" src="../script/zepto.min.js"></script>
<script type="text/javascript" src="../script/hashes.min.js"></script> 
 <script>
 	function goto_AddImageFun_show(imgUrl){
		var obj = api.require('imageBrowser');
		obj.openImages({
		    imageUrls: [imgUrl],
		    showList:false,
		    activeIndex:0
		});
	}
	apiready = function(){  
        /*加载详细*/
       	goto_loadInfoDetailFun();
       	
		/*如果用户处理了，进行刷新*/
		api.addEventListener({
		    name: 'Alpe_Event_yq_dosomething'
		}, function(ret){
		    if(ret){ 
		       goto_loadInfoDetailFun();
		    }
		});      
	}

	function goto_loadInfoDetailFun(){
		var infoID=api.pageParam.infoID;
		if(''==infoID||undefined==infoID||null==infoID){
    		api.alert({title:'系统提示',msg:'参数错误'});
			return;
    	}
    	api.showProgress({
		    style: 'default',
		    animationType: 'fade',
		    title: '',
		    text: '',
		    modal: false
		});
		
		var MD5 = new Hashes.MD5;   
       	var access_token = Alpe_getLocalStorge("access_token");                     
       	var admin_id = Alpe_getLocalStorge("admin_id"); 
       	var sign = MD5.hex(access_token+admin_id+infoID+'datas/getMsg1.0syjqingbao');
            
       	var url = Alpe_ApiUrl+'r=datas/getMsg&access_token='+access_token+'&admin_id='+admin_id
       		+'&message_id='+infoID 
       		+'&v=1.0&sign='+sign;
       	api.ajax({
	         url: url,
	         method: 'get',
	         cache: false,
	         timeout: 30,			
	         dataType: 'json'
       	}, function(ret, err){ 
			if (ret) {	 
				if(ret.success == '100'){
					$("#listtitle").html(ret.title);
			       	$("#from").html(ret.media_name);
			       	$("#date").html(ret.send_time);
			       	$("#url").html('<div onclick="goto_openPhoneBrowerFun(\''+ret.url+'\')" tapmode="presshover" style="color:blue">'+ret.url+'</div>');
			       	$("#content").html(ret.content);				                
			       	$("#description").html(ret.abstract_content);
			       	$("#remarks").html(ret.bak);
			       	$("#contact").html('<a href="tel:'+ret.tel+'" style="color:blue">'+ret.qb_tel+'</a>'); 
			       	
			       	api.sendEvent({
					    name: 'Alpe_Event_NewsDetailContent',
					    extra:{
						    keyID:'alpenlicebe', 
						    newsTitle:ret.title, 
						    newsDesc:ret.abstract_content, 
						    newsUrl:ret.detail_url
						}
					});
					//console.log($api.jsonToStr(ret.img_path));
					$.each(ret.img_path, function (index, v) {	  
						var html="<li class='aui-list-view-cell aui-img aui-col-xs-4' style='position: relative;text-align: center;margin: 0 auto'>"+ 
									        "<img style='height:100px' class='aui-img-object' src='"+v.pic_path+"'> "+
									        "<div style='text-align: center; padding-top: 5px; position: absolute;z-index: 999;top: 60px; left: 10px; bottom: 0; right: 0;'>"+
											 	"<button onclick=goto_AddImageFun_show('"+v.pic_path+"'); style='width:90%;' class='aui-btn aui-btn-primary'>点击查看</button>"+ 
											"</div>"+
									    "</li>";
					        	$("#ul_imgList").prepend(html);  
					});
					goto_openBottomMenuFun(ret.title,ret.abstract_content,ret.url,ret.is_collect,ret.is_pass,ret.pass_status,ret.deal_status,ret.is_deal,ret.forwarding_status);		
		  		}else if("002"==ret.success||"003"==ret.success){ 
					goto_openWin_loginWin(ret.message);
				}else{
		  			api.toast({
		         		msg: ret.message,
                 		duration:2000,
                    	location: 'middle'
               		});  
		  		}
		  		api.hideProgress();
			}else{
				api.alert({title:'系统提示',msg:'错误码：'+err.code+'；错误信息：'+err.msg+'网络状态码：'+err.statusCode});
				api.hideProgress();
			} 
   		});
	}
	/*底部操作菜单*/
	function goto_openBottomMenuFun(title,abstract_content,url,is_collect,is_pass,pass_status,deal_status,is_deal,forwarding_status){
		var infoID=api.pageParam.infoID;
		if(''==infoID||undefined==infoID||null==infoID){
    		api.alert({title:'系统提示',msg:'参数错误'});
			return;
    	} 
	    var h_height = api.frameHeight - 51;    
	    api.openFrame ({
            name: 'yq_menuBottom',
            url: './yq_menuBottom.html',
            rect:{
				x:0,
				y:h_height,
				w:'auto',
				h:51,
			},			
		    pageParam: {infoID:infoID,title:title,abstract_content:abstract_content,url:url,
		    		is_collect:is_collect,
		    		is_pass:is_pass,
		    		pass_status:pass_status,
		    		deal_status:deal_status,
		    		is_deal:is_deal,
		    		forwarding_status:forwarding_status
		    		},
		    delay: 300,	
		    reload:true,		 
		    bounces: false,			 
		    scaleEnabled:false,
		    delay:200  
		});
	}	 
	function goto_openPhoneBrowerFun(url){       		    
		if('ios'==api.systemType){
      		api.openApp({
				iosUrl: url
			},function(ret,err){ 
					     
			});
   		}	
        if('android'==api.systemType){
        	api.openApp({
			    androidPkg: 'android.intent.action.VIEW',
			    
			    uri: url
			},function(ret,err){ 
			});
        }	 	 
	} 
</script>
 
</html>